-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
566 recursive instantiate #989
Conversation
d2be456
to
5bd94d5
Compare
#995 : documentation followup |
67eade6
to
dce15c0
Compare
This pull request introduces 2 alerts when merging b9eaf50 into a523de2 - view on LGTM.com new alerts:
|
b9eaf50
to
6ab3129
Compare
This pull request introduces 2 alerts when merging 6ab3129 into 108af1a - view on LGTM.com new alerts:
|
6ab3129
to
8343d38
Compare
Hi! |
Hi @CatOfTheCannals, |
e4ac92b
to
011b6cd
Compare
cls = _get_cls_name(config) | ||
type_or_callable = _locate(cls) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for supporting objects! Since now any object can be put in the dict, can you allow _target_
to be the callable object itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is potentially doable but out of scope for this diff.
Can you open a new feature request and show an example where this would be preferred over passing the class/function name?
f0ec938
to
6ac5a62
Compare
@omry I don't know if I should open a feature request or if this is already possible, but suppose you have a complex hierarchy where most objects have to be recursively instantiated but for some we wish to defer the instantiation so that it can be managed inside the program. For example, if we wish to run large models sequentially on the same GPU, we wish to instantiate the second once we are done with the first. I had a feeling that bleurt:
_recursive_: false
_target_: datasets.load_metric but I'm getting the error Error in call to target 'datasets.load.load_metric':
TypeError("load_metric() missing 1 required positional argument: 'path'")
full_key: architecture.paraphrase_decoder.semantic_faithfulness_model
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace``` which suggests that |
@alexcoca I think you will need to pass foo:
_target_: bar
_recursive_: false
bleurt:
_target_: datasets.load_metric With this setup, I believe |
@Jasha10 Yes, this was the only way to get things working. I removed |
Add an upgrade page explaining change for default recursive(no need for an upgrade page).Closes #566
Closes #995